home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_05
/
9n05138a
< prev
next >
Wrap
Text File
|
1991-03-26
|
628b
|
23 lines
//construct login batch file name .......
strcpy(linbuf, STARTUP_DIR);
strcat(linbuf, users[i].name );
strcat(linbuf, ".bat" );
//find and run login script file .......
if( ( fp = fopen(linbuf, "r")) == NULL )
cprintf("Can't find user file %s\a\r\n",linbuf );
else {
char *comspec;
fclose(fp) ;
//overlay with command.com and run user batch ......
if( (comspec = getenv("COMSPEC")) == NULL )
exit(cprintf("No COMSPEC in environment\r\n"));
if(execlp(comspec,comspec,"/C",linbuf,NULL) == -1)
cprintf("Can't execute user file %s\a\r\n", linbuf);
}